<html>
	<head>
	    <title>refuse.html</title>
	    <meta http-equiv="content-type" content="text/html; charset=utf-8">
		<link href="../../css/general1.css" rel="stylesheet" type="text/css" />
		<!--<link rel="stylesheet" type="text/css" href="./styles.css">-->
		<link href="style/css.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript" src="../../script/hiawardbpm.js"></script>
		<script type="text/javascript" src="../../script/prototype.js"></script>
		<script type="text/javascript" src="/vchzms-hiaward/dwr/engine.js"> </script>
	    <script type="text/javascript" src="/vchzms-hiaward/dwr/util.js"> </script>
        <script type="text/javascript" src="/vchzms-hiaward/dwr/interface/OutService.js"></script>
		<script type="text/javascript" src="/vchzms-hiaward/dwr/interface/Dao.js"></script>
		<script type="text/javascript"
			src="/vchzms-hiaward/dwr/interface/SetKeyAndValueDwrAction.js"></script>
		<script type="text/javascript">
        function subForm(){
          var webData=buildWebData();
          var xmlMsg=window.dialogArguments;
          alert(xmlMsg.getXmlDocument().xml);
          xmlMsg.setCommand(12);
          xmlMsg.setWebData(webData);
          xmlMsg.buildXML();
          var url="/vchzms-hiaward/ProcessAjaxHandler";
          alert(xmlMsg.getXmlDocument().xml);
          new Ajax.Request(url,{
          method:'post',
          postBody:xmlMsg.getXmlDocument().xml,
          contentType:'application/x-www-form-urlencoded',
          encoding:'UTF-8',
          onComplete:function(transport){
	          try{
		          if(200==transport.status){
		               alert('成功创建了一个新任务');
		               
		               window.close();
		              }
		          if(400==transport.status){
		               alert('创建失败');
		              }
	          }catch(err){
	              alert('js异常');
	          }
          }
       });
         }
         function buildWebData(){
         var xmlMsg=window.dialogArguments;
	     var vchsid=xmlMsg.getWebData().getProperty('vchsid');
          var webData=new WebData();
          //var flag=document.getElementById('verifyState').checked;
          //var verifyState=(flag==true?'1':'0');
          var accno=document.getElementById("accno").value;
          var amount=document.getElementById("amount").value;
          var vchno=document.getElementById("vchno").value;
          //var subno=document.getElementById("subno").value;
          var brbank=document.getElementById("brbank").value;
          var vsbank=document.getElementById("vsbank").value;
          var vchtype=document.getElementById("vchtype").value;
          var vchdate=document.getElementById("vchdate").value;
          var vchpwd=document.getElementById("vchpwd").value;
          var rtreason=document.getElementById("rtreason").value;
          var telno=document.getElementById("telno").value;
          webData.setProperty('accno',accno);
          webData.setProperty('vchsidInput',vchsid);
          webData.setProperty('amount',amount);
          webData.setProperty('vchno',vchno);
          //webData.setProperty('subno',subno);
          webData.setProperty('brbank',brbank);
          webData.setProperty('vsbank',vsbank);
          webData.setProperty('vchtype',vchtype);
          webData.setProperty('vchdate',vchdate);
          webData.setProperty('vchpwd',vchpwd);
          webData.setProperty('rtreason',rtreason);
          webData.setProperty('telno',telno);
          return webData;
         }
         function getCustInfo(){
         var accno=$("accno").value;
            OutService.Z_BAPI_ACCOUNT_INFO(accno,function(data1){
              var custid=data1.custId;
              $("coName").innerHTML=data1.accName;
              $("remitter").value=data1.accName;
              OutService.Z_BAPI_BP_GET_ORG_DETAIL(custid,function(data2){
                $("connector").innerHTML=data2.connector;
                $("telno").innerHTML=data2.tel;
              });
           });
         }
         function getVoucherInfo(){
         var xmlMsg=window.dialogArguments;
	     var vchsid=xmlMsg.getWebData().getProperty('vchsid');
         Dao.getVoucherById(vchsid,function(data){
          $('accno').value=data.accno;
          $('vchno').value=data.vchno;
          $('amount').value=data.amount;
          $('vchtype').value=data.vchtype;
          $('vchpwd').value=data.vchpwd;
          $('vchdate').value=data.vchdate;
          $('brbank').value=data.brbank;
          $('vsbank').value=data.vsbank;
          $('telno').value=data.vchdate;
          getCustInfo();
            });
         }
    </script>		
	</head>
	<body>
	<center>
			<table width="900" border="1" cellspacing="0" cellpadding="0">
				<tr>
					<td width="65%" height="80">
						<table width="100%" border="1" cellspacing="0" cellpadding="0">
							<tr>
								<td>
									<img src="pic/00000001.jpg" width="601" height="283" />
								</td>
							</tr>
							<tr>
								<td>
									<img src="pic/00000002.jpg" width="601" height="283" />
								</td>
							</tr>
						</table>
					</td>
					<td width="35%" height="" valign="top">
						<span style="width: 28%" class="title1"> <a name="tag"
							class="selectli1">客户信息</a> </span>
						<table width="100%" border="0" cellpadding="0" cellspacing="0"
							class="tablist1">
							<tr>
								<td width="24%">
									公司名称:
								</td>
								<td>
									<span id="coName"></span>
								</td>
							</tr>
							<tr>
								<td>
									联系人:
								</td>
								<td>
									<span id="connector"></span>
								</td>
							</tr>
							<tr>
								<td>
									联系电话:
								</td>
								<td>
									<span id="telno"></span>
								</td>
							</tr>
							<tr>
								<td>
									备注:
								</td>
								<td>
									<span id="remark"></span>
								</td>
							</tr>
						</table>
						<span style="width: 28%" class="title1"> <a name="tag"
							class="selectli1">票据信息</a> </span>
						<table width="100%" border="0" cellpadding="0" cellspacing="0"
							class="tablist1">
							<tr>
								<td width="24%">
									账号:
								</td>
								<td width="76%">
									<input id="accno" name="accno" type="text" onblur="getCustInfo()"/>
								</td>
							</tr>
							<tr>
								<td>
									凭证号:
								</td>
								<td>
									<input name="vchno" type="text" id="vchno" />
								</td>
							</tr>
							<tr>
								<td>
									凭证类型:
								</td>
								<td>
									<input name="vchtype" type="text" id="vchtype"/>
								</td>
							</tr>
							<tr>
								<td>
									凭证日期:
								</td>
								<td>
									<input name="vchdate" type="text" id="vchdate"/>
								</td>
							</tr>
							<tr>
								<td>
									凭证金额:
								</td>
								<td>
									<input name="amount" type="text" id="amount"/>
								</td>
							</tr>
							<tr>
								<td>
									支付密码:
								</td>
								<td>
									<input name="vchpwd" type="text" id="vchpwd"/>
								</td>
							</tr>
							<tr>
								<td>
									密码结果:
								</td>
								<td>
									<span id="pswdres">通过</span>
								</td>
							</tr>
							<tr>
								<td>
									验印柜员:
								</td>
								<td>
									<span id="idclkno">黄兵</span>
								</td>
							</tr>
							<tr>
								<td>
									审票柜员:
								</td>
								<td>
									<span id="chkclkno">黄兵</span>
								</td>
							</tr>
							<tr>
								<td>
									退票理由:
								</td>
								<td>
									<input name="rtreason" type="text" id="rtreason" value="" />
								</td>
							</tr>
							<tr>
								<td>
									退入行:
								</td>
								<td>
									<input name="vsbank" type="text" id="vsbank" value="" />
								</td>
							</tr>
							<tr>
								<td>
									退出行:
								</td>
								<td>
									<input name="brbank" type="text" id="brbank" value="" />
								</td>
							</tr>
							<tr>
								<td>
									退出日期:
								</td>
								<td>
									<input name="drdate" type="text" id="drtdate" value="" />
								</td>
							</tr>
							<tr>
								<td>
									退出场次:
								</td>
								<td>
									<input name="drtsession" type="text" id="drtsession" value="" />
								</td>
							</tr>
							
							<tr>
								<td> 
									出票人（公司名称）: 
									 
								</td>
								<td>
									<input name="remitter" type="text" id="remitter" value="" />
								</td>
							</tr>
							<tr>
								<td>
									持票人:
								</td>
								<td>
									<input name="holder" type="text" id="holder" value="" />
								</td>
							</tr>
							
							<tr>
							   <!-- 在后台完成 不需前台显示 -->
								<td>
									大写金额(后台处理):
								</td>
								<td>
									<input name="amount_cn" type="text" id="amount_cn" value="" />
								</td>
							</tr>
							<tr>
								<td>
									退票电话:
								</td>
								<td>
									<input name="telno" type="text" id="telno" value="" />
								</td>
							</tr>
						</table>
				</tr>
			</table>
			<table width="40%" border="0" cellspacing="0" cellpadding="0">
				<tr>
					<td align="center" valign="bottom">
						<label>
							<input type="button" name="refuse" value="退 票"
								onclick="subForm()" class="btn1"/>
						</label>
						<label>
							<input type="button" name="next" value="下一条" class="btn1"/>
						</label>
						<input type="submit" name="Submit3" value="关闭"
							onClick="self.close()" class="btn1"/>
					</td>
				</tr>
			</table>
             
		</center>
	<script type="text/javascript">
	  getVoucherInfo();
	</script>
	</body>
	</html>